package com.drinks.yiniang.entity.shop;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.drinks.yiniang.entity.goods.GoodsJson;
import com.hansen.library.entity.BaseJson;

import java.util.List;

/**
 * @author han
 * @date 2019/11/4
 */
public class ShoppingCartJson extends BaseJson {

    public static final int ITEM_TYPE_CART_GOODS = 0x01;//购物车商品
    public static final int ITEM_TYPE_CART_RECOMMEND_TITLE = 0x02;//推荐标题
    public static final int ITEM_TYPE_CART_RECOMMEND = 0x03;//推荐商品

    private List<ShoppingCartList> data;

    public List<ShoppingCartList> getData() {
        return data;
    }

    public void setData(List<ShoppingCartList> data) {
        this.data = data;
    }

    public static class ShoppingCartList implements MultiItemEntity {
        private int mItemType = ITEM_TYPE_CART_GOODS;

        private String id;
        private String goods_id;
        private String goods_sku_id;
        private String num;
        private String goods_name;
        private String recommend_reason;
        private String cover_url;
        private String item_price;
        private String single_capacity;
        private String sku_name;
        private String sku_value;
        //推荐的商品params
        private String name;
        private String app_price;
        private List<GoodsJson.GoodsActivity> activity;
        //添加是否选中的字段
        private boolean isChecked;

        public void setItemType(int mItemType) {
            this.mItemType = mItemType;
        }

        @Override
        public int getItemType() {
            switch (mItemType) {
                case ITEM_TYPE_CART_GOODS:
                case ITEM_TYPE_CART_RECOMMEND_TITLE:
                case ITEM_TYPE_CART_RECOMMEND:
                    return mItemType;
                default:
                    return BaseMultiItemQuickAdapter.TYPE_NOT_FOUND;

            }
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getGoods_id() {
            return goods_id;
        }

        public void setGoods_id(String goods_id) {
            this.goods_id = goods_id;
        }

        public String getGoods_sku_id() {
            return goods_sku_id;
        }

        public void setGoods_sku_id(String goods_sku_id) {
            this.goods_sku_id = goods_sku_id;
        }

        public String getNum() {
            return num;
        }

        public void setNum(String num) {
            this.num = num;
        }

        public String getGoods_name() {
            return goods_name;
        }

        public void setGoods_name(String goods_name) {
            this.goods_name = goods_name;
        }

        public String getRecommend_reason() {
            return recommend_reason;
        }

        public void setRecommend_reason(String recommend_reason) {
            this.recommend_reason = recommend_reason;
        }

        public String getCover_url() {
            return cover_url;
        }

        public void setCover_url(String cover_url) {
            this.cover_url = cover_url;
        }

        public String getItem_price() {
            return item_price;
        }

        public void setItem_price(String item_price) {
            this.item_price = item_price;
        }

        public String getSingle_capacity() {
            return single_capacity;
        }

        public void setSingle_capacity(String single_capacity) {
            this.single_capacity = single_capacity;
        }

        public String getSku_name() {
            return sku_name;
        }

        public void setSku_name(String sku_name) {
            this.sku_name = sku_name;
        }

        public String getSku_value() {
            return sku_value;
        }

        public void setSku_value(String sku_value) {
            this.sku_value = sku_value;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getApp_price() {
            return app_price;
        }

        public void setApp_price(String app_price) {
            this.app_price = app_price;
        }

        public List<GoodsJson.GoodsActivity> getActivity() {
            return activity;
        }

        public void setActivity(List<GoodsJson.GoodsActivity> activity) {
            this.activity = activity;
        }

        public boolean isChecked() {
            return isChecked;
        }

        public void setChecked(boolean checked) {
            isChecked = checked;
        }
    }

}
